package com.itec.learn.java.abc.wait;

/**
 * 临界资源
 * @author chenyiqun
 */
public class Letters {
    private char letter = 'A';

    public void next(){
        switch (letter){
            case 'A':
                letter = 'B';
                break;
            case 'B':
                letter = 'C';
                break;
            case 'C':
                letter = 'A';
                break;
        }
    }

    public char get(){
        return letter;
    }

    public void print(){
        System.out.println(letter);
    }
}
